home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 49
/
Volume 49 - JOGO DISK .iso
/
Games
/
harrythehamster.swf
/
scripts
/
frame_44
/
DoAction.as
Wrap
Text File
|
2007-09-28
|
4KB
|
164 lines
if(drag && !mouseButton)
{
drag = false;
grid._visible = false;
pObj1[dragNum]._alpha = 100;
pObj1[dragNum]._xscale = 100;
pObj1[dragNum]._yscale = 100;
pObj1[dragNum].swapDepths(1000 + dragNum);
pObj2[dragNum]._alpha = 100;
pObj2[dragNum]._xscale = 100;
pObj2[dragNum]._yscale = 100;
pObj2[dragNum].swapDepths(2000 + dragNum);
pObj3[dragNum]._alpha = 100;
pObj3[dragNum]._xscale = 100;
pObj3[dragNum]._yscale = 100;
pObj3[dragNum].swapDepths(3000 + dragNum);
var dropOK = true;
var newX = mouseX;
var newY = mouseY;
if(status != "waiting" && status != "moving")
{
dropOK = false;
}
if(newX < 1 || newX > 8 || newY < 1 || newY > 7)
{
dropOK = false;
}
var i = 0;
while(i < oNum)
{
if(newX == oX[i] && newY == oY[i])
{
dropOK = false;
}
i++;
}
var i = 0;
while(i < pNum)
{
if(newX == pX[i] && newY == pY[i])
{
dropOK = false;
}
i++;
}
if(dropOK)
{
pX[dragNum] = newX;
pY[dragNum] = newY;
}
pos(pObj1[dragNum],pX[dragNum],pY[dragNum]);
pos(pObj2[dragNum],pX[dragNum],pY[dragNum]);
pos(pObj3[dragNum],pX[dragNum],pY[dragNum]);
}
if((status == "waiting" || status == "moving") && mouseButton && !mouseButtonLast && mouseX > 0 && mouseX < 9 && mouseY > 0 && mouseY < 8)
{
i = 0;
while(i < pNum)
{
if(pX[i] == mouseX && pY[i] == mouseY && !pUsed[i])
{
drag = true;
grid._visible = true;
dragNum = i;
pObj1[dragNum]._alpha = 60;
pObj1[dragNum]._xscale = 110;
pObj1[dragNum]._yscale = 110;
pObj1[dragNum].swapDepths(3997);
pObj2[dragNum]._alpha = 60;
pObj2[dragNum]._xscale = 110;
pObj2[dragNum]._yscale = 110;
pObj2[dragNum].swapDepths(3998);
pObj3[dragNum]._alpha = 60;
pObj3[dragNum]._xscale = 110;
pObj3[dragNum]._yscale = 110;
pObj3[dragNum].swapDepths(3999);
}
i++;
}
}
mouseButtonLast = mouseButton;
if(drag)
{
pObj1[dragNum]._x = _xmouse;
pObj1[dragNum]._y = _ymouse;
pObj2[dragNum]._x = _xmouse;
pObj2[dragNum]._y = _ymouse;
pObj3[dragNum]._x = _xmouse;
pObj3[dragNum]._y = _ymouse;
}
if(status == "dead")
{
dead.dY += 0.6;
dead._x += dead.dX;
dead._y += dead.dY;
dead.count--;
if(dead.count == 0)
{
status = "buried";
}
}
if(timer == maxTimer)
{
musicWaiting.gotoAndPlay(2);
}
if(status == "waiting")
{
timer -= 0.05;
}
clock.gotoAndStop(1 + Math.floor(990 * (maxTimer - timer) / maxTimer));
if(timer < 10 && soundTime._currentframe == 1)
{
soundTime.gotoAndStop(2);
}
if(timer <= 0 && status == "waiting")
{
stopAllSounds();
timer = 0;
start2.gotoAndPlay("cageOpen");
start3.gotoAndPlay("cageOpen");
status = "moving";
}
if(Math.random() < 0.012 && cat._currentframe == 1)
{
if(hamsterY > 4)
{
cat._rotation = 180;
cat._y = -38;
}
else
{
cat._rotation = 0;
cat._y = 524;
}
var i = Math.floor(1 + 5.99 * Math.random());
switch(i)
{
case 1:
cat.swapDepths(4500);
cat.gotoAndPlay("catAppear1");
break;
case 2:
cat.swapDepths(500);
cat.gotoAndPlay("catAppear2");
break;
case 3:
cat.swapDepths(500);
cat.gotoAndPlay("catAppear3");
break;
case 4:
cat.swapDepths(4500);
cat.gotoAndPlay("catAppear4");
break;
case 5:
cat.swapDepths(500);
cat.gotoAndPlay("catAppear5");
break;
case 6:
cat.swapDepths(500);
cat.gotoAndPlay("catAppear6");
}
cat._x = 32 + 70 * hamsterX + Math.floor(70 * Math.random());
}